﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            var account = TextBox1.Text;
            var pwd = TextBox2.Text;
           var bt = Dbhepr.dataTable(string.Format("select * from Users where Account='{0}' and PassWords = '{1}'", account, pwd)); 
            if(bt.Rows.Count == 1)
            {
                Response.Redirect("Default.aspx");
            }
            else
            {
                Label3.Text = "登录失败";
            }
        }
    }
}